package com.globalLogic.gps.maps.elements;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.globalLogic.geometry.Segment;
import com.globalLogic.gps.graph.INode;
import com.globalLogic.gps.maps.adapter.PointNodeAdapter;

public abstract class Road {

	private String description;
	private Segment segment;	
	private List<PointOfInterest> pois = new ArrayList<PointOfInterest>();
	
	protected Segment getSegment() {
		return segment;
	}

	protected void setSegment(Segment segment) {
		this.segment = segment;
	}



	
	public List<PointOfInterest> getPois() {
		return pois;
	}

	public void setPois(List<PointOfInterest> pois) {
		this.pois = pois;
	}

	public String getDescription() {
		return description;
	}

	public Road( ) {
		super();
		
	}
	public Road(double latitude, double longitude,double latitude2, double longitude2 ) {
		super();
		segment = new Segment(latitude, longitude, latitude2, longitude2);
	}
	
	@Override
	public String toString() {
		return "Road [description=" + description + ", segment=" + segment
				+ "]";
	}
	
	public List <PointNodeAdapter> getNodes()
	{
		return Arrays.asList(new PointNodeAdapter(getSegment().getStart()), new PointNodeAdapter(getSegment().getEnd()));
	}


	public INode getStart ()
	{
		
		return new PointNodeAdapter(getSegment().getStart());
	}
	
	public INode getEnd ()
	{
		
		return new PointNodeAdapter(getSegment().getEnd());
	}
	
	public double getLength ()
	{
		return getSegment().getLength();
	}
	
	public double getPrice()
	{
		
		return 0;
	}
	
	public boolean haveToll()
	{
		return false;
	}
	
	public boolean isAsphalt()
	{
		return false;
	}
	
	
	public boolean isDirty()
	{
		return true;
	}
	
}
